None
In order to safely operate your workstation motor inertia module, you will need to implement a safety control system. OK, so there isn't much chance of serious injury with the rig we have given you. However, it is true that you don't want the motor to run when you are not expecting it, especially if you are making adjustments. The most likely risk is you will damage the rig, even breaking som eof the 3D printed parts, and it will take time to repair. A safety system that ensures that the plexiglass shield is closed while the motor is running can help with this and save your from lost time. Large machines will have exactly the same kind of safety systems when their operation carries substantial risk of injury. With all of these factors in mind, it is important to understand how FSM programming could provide a framework to build a robust safety system.
Your safety system will use the relay to control the overall operation of the motor such that:
The motor will be controled by the relay we have already used in Labs 1 and 2. When this relay is energized, the motor will be connected to a power source. If the relay is not energized the motor will be disconnected from the power source and therefore will not be allowed to spin.
You will use your workstation's safety control section and the LCD panel to control the operation and display the status of your system. The safety control section consists of the buttons, switch, and LEDs at the bottom of the circuit board below the breadboard. They, and an example of the LCD output are pictured below. All of the switches, buttons and LEDs in the Safety Control Section are connected to the Arduino through the circuit board and the pin numbers for each of them can be found in the Hardware Resource. Note that the black buttons (BTN1, BTN2, etc) are momentary switches that only change state while being pressed. The E-Stop button is a "mechnically latching" button that will stay pressed until pressed again.
The LCD display will be used to display the condition of the motor. Details on how to use the display are in the Hardware Resource. You will display "MOTOR" and "CONNECTD" or "DISSCNTD" as shown in the images below.
delay() to achieve this is UNACCEPTABLE in this application because it would mean the entire program STOPS processing for 100 ms. If a fault occured in that time, the program would not be able to respond! Therefore, you will need to make use of a timer to output to the LCD at an interval of your choice without pausing the entire program.You will be using the Inertial Module for this lab, but you won't be connecting the inertia mass to the motor yet. Remove your gate module and reattach the Inertial Model using the two thumbscrews shown below Notice that the extension on the motor inertial shield contacts the shield limit switch when it is fully closed.
Confirm the motor is still connected to the MOTOR2 socket and the wires coming from the inertia module are connected to the MOTOR1 socket. We won't use the electronics on the inertia module in this lab, but this will keep the wires away from the motor and get you set up for lab 4.
Use a "flex coupler" to attach the inertia shaft and the motor shaft together. Make sure to align the flat part of the "D" shaft with the sockets in the coupler. If the shaft cannot be inserted all the way, you may need to use a small screwdriver to clear any errant PLA material blocking it.
The same relay we used in lab 1 and 2 also connects the motor to the second H-bridge. So the same pin on the arduino will be used to control the relay to turn the motor on and off.
A solid state switch, like a transistor, could have been used instead of a relay. However, as a safety feature, the relay is a better choice because the motor is physically disconnected from the circuit so there is no chance current could "leak" across the relay. Solid state electronics can fail such that current can pass unexpectedly. Additionally, a relay is less expensive, dissipates less heat, and allowes us to easily run current in both directions through the motor. A relay was also an appropriate choice because it is not expected to switch at high frequencies or for a large number of cycles over its design life cycle in this application.
Finally, your relay is also designed to "FAIL SAFE" by staying in the open position, and stopping the motor, if it loses power.
Because you are still developing an understanding of FSM design, you are provided a complete state transition diagram and partial table below.
| Transition | Starting State | Transition Condition | Ending State |
|---|---|---|---|
| A | READY | (!(Run1 && Run2 && SlideToReady)||!SlideToReady )&& !(Estop || Limit) | READY |
| B | READY | Run1 && Run2 && SlideToReady && !(Estop || Limit) | WARNING |
| C | WARNING | Run1 && Run2 && !WarningTimer && SlideToReady && !(Estop || Limit)) | WARNING |
| D | WARNING | READY | |
| E | WARNING | WarningTimer && SlideToReady && !(Estop || Limit) | RUNNING |
| F | RUNNING | SlideToReady && !(Estop || Limit) | RUNNING |
| G | RUNNING | !SlideToReady && !(Estop || Limit) | READY |
| H | RUNNING | FAULT | |
| I | WARNING | FAULT | |
| J | READY | FAULT | |
| K | FAULT | Estop || Limit || SlideToReady | FAULT |
| L | FAULT | READY |
Based on the State Transition Diagram, complete the State Transition Table for this system. You can copy the table above into the graded Markdown cell below and just add the missing elements. Before you submit, ensure the diagram and table are consistent with your final program below.
Note that the pipe character "|" is used represent an OR in boolean logic as "||", but it is also used to define the size of the Markdown tables! If you put this in your markdown code, it will be interpreted as a table formatting command and create a very confused table!
To tell the code that you just want to print the character exactly as you type it, place a backslash "\" before each pipe character. So to print "||" you would type "\|\|".
YOUR ANSWER HERE
Using the 4 Block structure, implement your controller design in Arduino code. "If" statements are not used in Block 2 or 3, but are expected in Block 4. Boolean algebra is used in Block 2 and 3 for clarity and efficiency.
Place your Arduino Code in the cell below using proper formatting (with ~~~c before and ~~~ after).
YOUR ANSWER HERE
In order to test your design and confirm it is validated, record a video of you performing the following sequence of actions. Make sure to NARRATE the steps you are being asked to take as you step through the demonstration.
Put a LINK to a video of your controller validation in the cell below. You can use media.lafayette.edu, youtube, vimeo, etc. to host your video
YOUR ANSWER HERE